#include <stdlib.h>
#include <omp.h>
#include <stdio.h>
//#define NUM_THREADS 16
//编译指令
//gcc -std=c99 -fopenmp 3FirstPrivateAndLastPrivate.c -o cmake-build/3FirstPrivateAndLastPrivate && export OMP_NUM_THREADS=512 && time ./cmake-build/3FirstPrivateAndLastPrivate

int main()
{
    int val=8;
#pragma omp parallel for firstprivate(val) lastprivate(val)  default(none)
    for(int i=0;i<2;i++)
    {
        printf("i=%d val=%d\n",i,val);
        if(i==1)
            val=10000;
        printf("i=%d val=%d\n",i,val);
    }
    printf("val=%d\n",val);
    return 0;
}
